$(document).ready(function()//When the dom is ready 

{
	$("#searchButton").click(function() 
	{ //if theres a change in the username textbox

if (error == false) {

	$.ajax({  //Make the Ajax Request
    type: "GET",  
    url: "images.php",  //file name
    data: "search="+search,  //data
    success: function(server_response){  
   
			$("#register").ajaxComplete(function(event, request){ 

					window.location.href = data.redirect;

			});
   } 
   
  }); 
}
	return false;




  }); 
  
 
});